<?php

/**
 * Subclass for performing query and update operations on the 'image' table.
 *
 * 
 *
 * @package lib.model
 */ 
class ImagePeer extends BaseImagePeer
{
  public static function retrieveByPkWithI18n($pk)
  {
    $c = new Criteria();
    $c->add(ImagePeer::ID, $pk);
    $c->setLimit(1);
    foreach (ImagePeer::doSelectWithI18n($c) as $image)
    {
      return $image;
      break;
    }
  }

  public static function retrieveByPostIdAndPk($post_id, $pk)
  {
    $image = ImagePeer::retrieveByPk($pk);
    if($image instanceof Image)
    {
      return $image->getPostId() === $post_id ? $image : false;
    }
    return false;
  }
}
